package util;

import java.io.File;
import java.net.URL;

/**
 * Created by hanrchen on 2016/7/13.
 */
public class MyFile {

    public static File findResourceFile(String fileName) throws Exception {
        URL systemResource = ClassLoader.getSystemResource(fileName);
        if(systemResource == null){
            throw new Exception("No such file "+ fileName + " can be found, please check the file name");
        }
        return  new File(systemResource.toURI());
    }
}
